program erato;

const
   N = 10000000;
     
var
   sito	: array[1..N] of integer;
   i, j	: cardinal;
	
begin
   for i := 2 to N do sito[i] := 1;
   for i := 2 to N do
   begin
      j := i;
      while i*j <= N do
      begin
	 sito[i*j] := 0;
	 j := j+1;
      end;
   end;
   for i := 2 to N do
      if sito[i] <> 0 then write(i, ' ');
   writeln();
end.
